<?php
    $_GET['x'] = 2;
    include '../../ConfigSite/DataBase/DB_Conexion.php';
    include '../../ConfigSite/Smarty/ConfigSmarty.php';
    include '../Model/mld_Cursos.php';
    session_start();
    $time = time() - $_SESSION["NowTime"];
    if ( $_SESSION["Usuario"] !== null and $time <= 600) {
           $_SESSION["NowTime"] = time();
           
        $conn= new DB_Conexion(2);
        $model = new mld_Cursos($conn->db);
        $rs = $model->IngresarCurso($_POST['materia'], $_POST['curso']);
        if ($rs == true) {
            echo 'true';
        }  else {
            echo 'false'; 
        }
        
    }  else {
         header("Location: ../../Login");
    }
    
    

?>
